{include file="public/layout" /}
<body class="bodystyle" style="cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    {include file="admin/admin_bar" /}
    <div class="flexigrid">
        <div class="mDiv">
            <div class="ftitle">
               {eq name='$main_lang' value='$admin_lang'}
                   {eq name="$Think.const.CONTROLLER_NAME.'@admin_add'|is_check_access" value="1"}
                   <div class="fbutton">
                       <a href="javascript:void(0);" data-href="{:url('Admin/admin_add')}" onclick="openFullframe(this, '新增管理员', '100%', '100%');">
                           <div class="add" title="新增管理员">
                               <span><i class="layui-icon layui-icon-addition"></i>新增管理员</span>
                           </div>
                       </a>
                   </div>
                   {/eq}
               {/eq}
            </div>
            <form class="navbar-form form-inline" action="{:url('Admin/index')}" method="get" onsubmit="layer_loading('正在处理');">
                {$searchform.hidden|default=''}
                <div class="sDiv">
                    <div class="sDiv2">
                        <input type="text" size="30" name="keywords" value="{$Request.param.keywords}" class="qsbox" placeholder="搜索相关数据...">
                        <input type="submit" class="btn" value="搜索">
						<i class="fa fa-search"></i>
                    </div>
                </div>
            </form>
        </div>
        <div class="hDiv">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0" style="width: 100%">
                    <thead>
                    <tr>
                        {eq name='$main_lang' value='$admin_lang'}
                        <th class="sign w40" axis="col0">
                            <div class="tc"><input type="checkbox" class="checkAll"></div>
                        </th>
                        {/eq}
                        <th abbr="article_title" axis="col3" class="w40">
                            <div class="tc">ID</div>
                        </th>
                        <th abbr="ac_id" axis="col4">
                            <div class="text-l10">用户名</div>
                        </th>
                        <th abbr="ac_id" axis="col4" class="w150">
                            <div class="tc">真实姓名</div>
                        </th>
                        <th abbr="article_show" axis="col5" class="w150">
                            <div class="tc">权限组</div>
                        </th>
                        <th abbr="article_time" axis="col6" class="w120">
                            <div class="tc">手机号码</div>
                        </th>
                        <th abbr="article_time" axis="col6" class="w160">
                            <div class="tc">最后登录时间</div>
                        </th>
                        <th axis="col1" class="w120">
                            <div class="tc">操作</div>
                        </th>
                        
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
        <div class="bDiv" style="height: auto; min-height: auto;">
            <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                <table style="width: 100%">
                    <tbody>
                    {empty name="list"}
                        <tr>
                            <td class="no-data" align="center" axis="col0" colspan="50">
                                <i class="fa fa-exclamation-circle"></i>没有符合条件的记录
                            </td>
                        </tr>
                    {else/}
                        {foreach name="list" item="vo" key="k" }
                        <tr>
                            {eq name='$main_lang' value='$admin_lang'}
                            <td class="sign">
                                <div class="w40 tc">
                                    {if condition="$Think.session.admin_id != $vo.admin_id AND !empty($vo.parent_id)"}
                                    <input type="checkbox" name="ids[]" value="{$vo.admin_id}">
									{else/}
									<input disabled type="checkbox" name="ids[]" value="{$vo.admin_id}">
                                    {/if}
                                </div>
                            </td>
                            {/eq}
                            <td class="sort">
                                <div class="w40 tc">{$vo.admin_id}</div>
                            </td>
                            <td style="width: 100%">
                                <div class="text-l10">
                                    {eq name="'Admin@admin_edit'|is_check_access" value="1"}
                                    <a href="javascript:void(0);" data-href="{:url('Admin/admin_edit',array('id'=>$vo['admin_id']))}" onclick="openFullframe(this, '编辑管理员', '100%', '100%');">{$vo.user_name}</a>
                                    {else /}
                                    {$vo.user_name}
                                    {/eq}
                                </div>
                            </td>
                            <td>
                                <div class="w150 tc">
                                    {$vo.true_name}
                                </div>
                            </td>
                            <td>
                                <div class="w150 tc">{$vo.role_name|default='<em class="red">数据出错</em>'}</div>
                            </td>
                            <td>
                                <div class="w120 tc">
                                    {$vo.mobile|default='无'}
                                </div>
                            </td>
                            <td class="">
                                <div class="tc w160">
                                {empty name="vo.last_login"}
                                未登录
                                {else /}
                                {$vo.last_login|date='Y-m-d H:i:s',###}
                                {/empty}
                                </div>
                            </td>
                            <td class="operation">
                                <div class="w120 tc">
                                    {eq name="'Admin@admin_edit'|is_check_access" value="1"}
                                    <a href="javascript:void(0);" data-href="{:url('Admin/admin_edit',array('id'=>$vo['admin_id']))}" class="btn blue" onclick="openFullframe(this, '编辑管理员', '100%', '100%');">编辑</a>
                                    {/eq}
                                    {eq name='$main_lang' value='$admin_lang'}
                                    {eq name="'Admin@admin_del'|is_check_access" value="1"}
                                        {if condition="$Think.session.admin_id != $vo.admin_id AND !empty($vo.parent_id)"}
										<i></i>
                                        <a class="btn red"  href="javascript:void(0);" data-url="{:url('Admin/admin_del')}" data-id="{$vo.admin_id}" onClick="delfun(this);">删除</a>
										{else /}
										<i></i>
										<a class="btn grey"  href="javascript:void(0);" data-id="{$vo.admin_id}">删除</a>
                                        {/if}
                                    {/eq}
                                    {/eq}
                                </div>
                            </td>
                        </tr>
                        {/foreach}
                    {/empty}
                    </tbody>
                </table>
            </div>
            <div class="iDiv" style="display: none;"></div>
        </div>
        <div class="tDiv">
            <div class="tDiv2">
                {eq name='$main_lang' value='$admin_lang'}
                    {eq name="$Think.const.CONTROLLER_NAME.'@admin_del'|is_check_access" value="1"}
                    <div class="fbutton checkboxall">
                        <input type="checkbox" class="checkAll">
                    </div>
                    <div class="fbutton">
                        <a onclick="batch_del(this, 'ids');" data-url="{:url('Admin/admin_del')}" class="layui-btn layui-btn-primary">
                                <span>批量删除</span>
                        </a>
                    </div>
                    {/eq}
                {/eq}
                {include file="public/page" /}
            </div>
            <div style="clear:both"></div>
        </div>
       
       </div>
</div>
<input type="hidden" name="head_pic" id="head_pic" value="{$Think.session.admin_info.head_pic|get_head_pic=###}">
<script>
    $(function(){
        $('input[name*=ids]').click(function(){
            if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
                $('.checkAll').prop('checked','checked');
            } else {
                $('.checkAll').prop('checked', false);
            }
        });
        $('input[type=checkbox].checkAll').click(function(){
            $('input[type=checkbox]').prop('checked',this.checked);
        });
    });
    
    $(document).ready(function(){
        // 表格行点击选中切换
        $('#flexigrid > table>tbody >tr').click(function(){
            $(this).toggleClass('trSelected');
        });

        // 点击刷新数据
        $('.fa-refresh').click(function(){
            location.href = location.href;
        });

        // 上传头像及时显示
        $('#admin_head_pic', window.parent.document).attr('src', $('#head_pic').val());
    });
</script>

{include file="public/footer" /}